<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
	<head>	
		<script type='text/javascript' src='http://code.jquery.com/jquery-latest.js'></script>
		<script type='text/javascript' src='delegate.js'></script>
		<script type='text/javascript'>
			jQuery(function () {				
				jQuery('#delegator').delegate('p > a', 'click', function (e, delegator) {
					console.debug("oooh", this, e, delegator);
					jQuery(this).css('color', 'red');
				});
			});
		</script>
		<title>delegator</title>
	</head>		
	<body>
		<p><a>outside delegator</a></p>
		<div id="delegator">
			<a>zero(no)</a>
			<p><a>one(yes)</a></p>
			<p><span>[two(no)]</span><a>[two(yes)<span>{inside}</span>]</a></p>
			<p>three</p>
			<p>four</p>
			<p>five</p>
		</div>
	</body>
</html>